home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
gfxfx
/
copper2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-04-20
|
1KB
|
78 lines
{$g+}
program copper;
{ Again copper-stuff (2), by Bas van Gaalen, Holland, PD }
uses crt;
const
pal : array [0..3*28-1] of byte =
(4,2,2,8,4,4,12,6,6,16,8,8,20,10,10,24,12,12,28,14,14,32,16,16,
36,18,18,40,20,20,44,22,22,48,24,24,52,26,26,52,26,26,56,28,28,
56,28,28,60,30,30,60,30,30,60,30,30,63,33,33,63,33,33,63,33,33,
63,33,33,63,33,33,60,30,30,56,28,28,52,26,26,48,24,24);
procedure copperbars(var colors; lines : word; count : byte); assembler;
var i : byte;
asm
cli
cld
push ds
mov ah,0
mov dh,3
@l0:
mov dl,0dah { vertical retrace }
@vert1:
in al,dx
test al,8
jnz @vert1
@vert2:
in al,dx
test al,8
jz @vert2
mov bh,1
mov di,[lines]
@l1:
mov bl,bh
inc bh
lds si,[colors]
@l2:
mov dl,0c8h
mov al,ah
out dx,al
inc dx
outsb
outsb
mov dl,0dah { horizontal retrace }
@hor1:
in al,dx
test al,1
jnz @hor1
@hor2:
in al,dx
test al,1
jz @hor2
mov dl,0c9h
outsb
dec di
jz @out
dec bl
jnz @l2
jmp @l1
@out:
dec count
jnz @l0
pop ds
sti
end;
begin
repeat copperbars(pal,380,8); until keypressed;
end.